<template>
  <div>
    <div class="bookBean">
      <div class="bookBeantitle">
        <i
          class="iconfont icon-xiangzuo"
          @click="$router.go(-1)"
        ></i>
        <div class="story">书豆充值</div>
        <div class="help">帮助</div>
      </div>

      <div class="bookBeanContent">
        <div class="bookBeanMoney">
          <div :class="['special', { moneyCon: flag == 0 }]" @click="flag = 0">
            <div class="original">
              <h1>￥<span>1</span></h1>
              <p>原价1元</p>
            </div>

            <div class="tehui">
              <h1>特惠立得书 <span>10</span> 书豆</h1>
              <p>首充用户专享，送30券</p>
            </div>
            <i class="iconfont icon-31xuanzhong"></i>
          </div>

          <ul>
            <li :class="{ moneyCon: flag == 1 }" @click="flag = 1">
              <div class="bTitle">￥<span>200</span></div>
              <div class="bBean">2000书豆</div>
              <i class="iconfont icon-31xuanzhong"></i>
            </li>

            <li :class="{ moneyCon: flag == 2 }" @click="flag = 2">
              <div class="bTitle">￥<span>100</span></div>
              <div class="bBean">
                1000书豆
                <div class="coupon">送500券</div>
                <i class="iconfont icon-31xuanzhong"></i>
              </div>
            </li>

            <li :class="{ moneyCon: flag == 3 }" @click="flag = 3">
              <div class="bTitle">￥<span>50</span></div>
              <div class="bBean">500书豆</div>
              <i class="iconfont icon-31xuanzhong"></i>
            </li>

            <li :class="{ moneyCon: flag == 4 }" @click="flag = 4">
              <div class="bTitle">￥<span>30</span></div>
              <div class="bBean">
                300书豆
                <div class="coupon">送100券</div>
                <i class="iconfont icon-31xuanzhong"></i>
              </div>
            </li>

            <li :class="{ moneyCon: flag == 5 }" @click="flag = 5">
              <div class="bTitle">￥<span>12</span></div>
              <div class="bBean">120书豆</div>
              <i class="iconfont icon-31xuanzhong"></i>
            </li>

            <li :class="{ moneyCon: flag == 6 }" @click="flag = 6">
              <div class="bTitle">￥<span>6</span></div>
              <div class="bBean">60书豆</div>
              <i class="iconfont icon-31xuanzhong"></i>
            </li>
          </ul>
        </div>

        <div class="payMode">
          <h1>请选择支付方式</h1>
          <ul :class="{ conPay: !usePay }">
            <li :class="{ pointPay: pPay == 0 }" @click="pPay = 0">
              <div class="way">
                <i class="zfb iconfont icon-zhifubao"></i>
                <p>支付宝</p>
              </div>

              <i class="point iconfont icon-31xuanzhong"></i>
            </li>

            <li :class="{ pointPay: pPay == 1 }" @click="pPay = 1">
              <div class="way">
                <i class="hb iconfont icon-mayihuabei"></i>
                <p>花呗</p>
              </div>

              <i class="point iconfont icon-31xuanzhong"></i>
            </li>

            <li :class="{ pointPay: pPay == 2 }" @click="pPay = 2">
              <div class="way">
                <i class="wx iconfont icon-weixin"></i>
                <p>微信</p>
              </div>

              <i class="point iconfont icon-31xuanzhong"></i>
            </li>
          </ul>
          <div class="nthPlay" v-show="usePay" @click="beanPay">
            更多可使用的支付方式
            <i class="iconfont icon-xiala"></i>
          </div>
        </div>

        <div class="prompt">
          <div class="beanTop">
            <h1>温馨提示</h1>
          </div>
          <div class="content">
            <p>1. 充值比例为1元=10书豆</p>
            <p>
              2.
              充值过程中若遇到问题，您可以点击书架右下角的“我的”-意见反馈-点充值板块的问题，找到“在线人工客服”联系我们
            </p>
            <p>3. 充值完成后请尽快绑定账号，以确保账户资金安全</p>
            <p>4. 本页面显示的赠送金额，为相应充值方式的最高金额赠送数量</p>
            <p>
              5.
              充值赠送豆券将在充值成功后5分钟内下发;新用户首次充值不与常规充值赠送叠加;获赠豆券有有效期，请及时使用，避免过期哦
            </p>
          </div>
          <div class="bottom">
            <p>充值即同意<span>《用户协议》</span></p>
          </div>
        </div>
      </div>

      <div class="yesOK">
        <div class="rightNow">立即充值</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      flag: 2,
      pPay: 0,
      usePay: true,
    };
  },
  methods: {
    beanPay() {
      this.usePay = false;
    },
  },
  created() {
    this.$emit("getnavs-btn", false);
  },
};
</script>

<style lang= 'less'>
.bookBean {
  width: 100%;
  height: 100%;

  .bookBeantitle {
    position: fixed;
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: baseline;
    background-color: #fff;
    z-index: 1;
    text-align: center;
    line-height: 50px;
    i {
      flex: 0 0 40px;
      font-size: 20px;
    }
    .story {
      flex: 1;
      font-size: 18px;
    }
    .help {
      flex: 0 0 40px;
      font-size: 14px;
    }
  }
  .bookBeanContent {
    padding: 50px 0;
    .bookBeanMoney {
      padding: 8px 15px;
      .special {
        background-color: #fff;
        display: flex;
        position: relative;
        border: 1px solid transparent;
        .original {
          padding: 20px;
          border-right: 1px solid #f6f7f9;
          h1 {
            display: flex;
            align-items: baseline;
            span {
              display: block;
              font-size: 35px;
            }
          }
          p {
            text-decoration: line-through;
            font-size: 12px;
            color: #969799;
            margin-top: 8px;
          }
        }
        .tehui {
          flex: 1;
          padding: 20px;

          h1 {
            font-size: 16px;
            padding: 8px 0;
          }
          p {
            color: #eb8c05;
            margin-top: 8px;
            font-size: 13px;
          }
        }
        i {
          position: absolute;
          bottom: 0;
          right: 0;
          color: rgb(35, 179, 130);
          display: none;
        }
      }
      ul {
        width: 100%;
        margin-top: 6px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        li {
          width: 49.8%;
          margin-bottom: 2px;
          background-color: #fff;
          text-align: center;
          padding: 15px 0;
          position: relative;
          border: 1px solid transparent;
          box-sizing: border-box;
          .bTitle {
            span {
              font-size: 30px;
            }
          }
          .bBean {
            font-size: 13px;
            margin-top: 8px;
            color: #969799;
            display: flex;
            align-items: baseline;
            justify-content: center;
            .coupon {
              margin-left: 4px;
              padding: 3px 5px;
              border-radius: 4px;
              background-color: #d92e2e;
              color: #fff;
              font-size: 12px;
            }
          }
          i {
            position: absolute;
            bottom: 0;
            right: 0;
            color: rgb(35, 179, 130);
            display: none;
          }
        }
      }
      .moneyCon {
        border-color: rgb(35, 179, 130);
        i {
          display: block;
        }
      }
    }

    .payMode {
      margin-top: 4px;
      padding: 0 15px;
      h1 {
        color: #999;
        font-size: 13px;
      }
      ul {
        padding-top: 8px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        height: 70px;
        overflow: hidden;
        li {
          width: 49.2%;
          margin-bottom: 8px;
          border: 1px solid transparent;
          padding: 15px 0;
          box-sizing: border-box;
          display: flex;
          justify-content: center;
          align-items: center;
          background-color: #fff;
          text-align: center;
          position: relative;
          .way {
            i {
              font-size: 25px;
              margin-right: 4px;
            }
            p {
              font-size: 14px;
            }
            .zfb {
              color: #06b4fd;
            }
            .hb {
              color: #06b4fd;
            }
            .wx {
              color: #23b382;
              font-size: 28px;
            }
          }
          .point {
            position: absolute;
            bottom: 0;
            right: 0;
            color: rgb(35, 179, 130);
            display: none;
          }
        }
      }
      .pointPay {
        border-color: rgb(35, 179, 130);
        .point {
          display: block;
        }
      }
      .nthPlay {
        font-size: 14px;
        padding-top: 10px;
      }
      .conPay {
        height: auto;
      }
    }

    .prompt {
      padding: 0 15px;
      color: #969799;
      .beanTop {
        padding: 20px 0;
        text-align: center;
        position: relative;
        h1 {
          padding-top: 15px;
          font-size: 13px;
        }
        ::after,::before {
          content: "";
          display: block;
          width: 120px;
          height: 1px;
          background-color: #dddddd;
          position: absolute;
          top: 40px;
          right: 10px;
        }
        ::before{
          left: 10px;
        }
      }
      .content {
        font-size: 13px;
        p {
          padding-top: 6px;
        }
      }
      .bottom {
        padding-top: 20px;
        padding-bottom: 8px;
        text-align: center;
        font-size: 12px;
        span {
          color: rgb(35, 179, 130);
        }
      }
    }
  }

  .yesOK {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 6px 15px;
    background-color: #fff;
    box-sizing: border-box;

    .rightNow {
      border-radius: 6px;
      background-color: rgb(35, 179, 130);
      color: #fff;
      margin: auto;
      height: 40px;
      text-align: center;
      line-height: 40px;
      font-size: 16px;
    }
  }
}
</style>